package com.zmn.oms.third.tmall;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Component;

/**
 * 天猫勤鸽聚石塔接入常量定义
 *
 * @author xiewenbing
 * @date 2021/7/12
 */
@Component
public class TmallConsts {

    /**
     * 渠道对接开关
     */
    public static boolean POWER_ON = true;

    /**
     * 渠道名称
     */
    public final static String CHANNEL_NAME = "天猫勤鸽保外服务";

    /**
     * redis 保存超时设置
     */
    public final static int REDIS_EXPIRE_SECONDS = 7 * 24 * 60 * 60;

    /**
     * 天猫订单处理状态
     */
    public final static int TMALL_ORDER_STATE_QUERYING = 1;
    public final static int TMALL_ORDER_STATE_QUERY_FAILED = 2;
    public final static int TMALL_ORDER_STATE_CREATING = 3;
    public final static int TMALL_ORDER_STATE_CREATE_FAILED = 4;
    public final static int TMALL_ORDER_STATE_CREATE_SUCCESS = 5;

    /**
     * 天猫订单查询最大次数
     */
    public final static int TMALL_ORDER_MAX_QUERY_COUNT = 5;

    /**
     * 师傅缺省填入
     */
    public final static String MASTER_DEFAULT_NAME = "啄木鸟师傅";

    /**
     * 师傅联系手机号
     */
    public final static String MASTER_MOBILE = "15730252174";

    /**
     * 聚石塔 URL
     */
    public static String JST_URL = "http://39.103.228.201/tmall/api";

    /**
     * 聚石塔查询订单-PATH
     */
    public static final String JSZ_QUERY_ORDER_PATH = "/queryOrder";

    /**
     * 聚石塔派单-PATH
     */
    public static final String JSZ_ORDER_DISTRIBUTE_PATH = "/orderDistribute";

    /**
     * 聚石塔改约-PATH
     */
    public static final String JSZ_ORDER_RESEFVE_PATH = "/orderReserve";

    /**
     * 聚石塔订单挂起-PATH
     */
    public static final String JSZ_ORDER_SUSPEND_PATH = "/orderSuspend";

    /**
     * 聚石塔核销完成-PATH
     */
    public static final String JSZ_ORDER_IDENTIYF_PATH = "/orderIdentify";

    /**
     * 聚石塔签到-PATH
     */
    public static final String JSZ_ORDER_SIGNIN_PATH = "/orderSignin";

    //***********************************************************************************************

    @NacosValue(value="${tmall.api.powerOn:false}", autoRefreshed = true)
    public void setPowerOn(boolean powerOn) {
        POWER_ON = powerOn;
    }

    @NacosValue(value="${tmall.jst.url:http://39.103.228.201/tmall/api}", autoRefreshed = true)
    public void setJstUrl(String jstUrl) {
        JST_URL = jstUrl;
    }
}
